package test.san.baseproject.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import org.jetbrains.anko.startActivity

abstract class BaseAvtivity: AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayoutId())
        initLister()
        initData()
    }

    open public fun initData() {

    }

    open public fun initLister() {

    }

    abstract fun getLayoutId(): Int


    protected inline fun <reified T: BaseAvtivity> startActivityFinish() {
        startActivity<T>()
        finish()
    }
}